package com.snow.platform.organization.controller;

import com.baomidou.mybatisplus.mapper.Condition;
import com.snow.platform.organization.po.Org;
import com.snow.platform.organization.service.api.OrgService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("org")
public class OrgController {

    private static Logger logger = LoggerFactory.getLogger(OrgController.class);

    @Autowired
    private OrgService orgService;

    @RequestMapping("/add")
    @ResponseBody
    public String add(){
        logger.error("bbb-add");
        return "bbb-add";
    }

    @RequestMapping("/list")
    @ResponseBody
    public List<Org> list(){
        List<Org> orgList = orgService.selectList(Condition.create());
        return orgList;
    }
}
